function handleDialogRequest(xhr, status, args) {
    if(args.validationFailed || !args.success) {
        jQuery('#dialog-content').effect("shake", {
            times:3
        }, 100);
    } else {
        dlg.hide();
    }
}